home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Copyright (C) 1987 Pehong Chen (phc@renoir.berkeley.edu)
- * Computer Science Division
- * University of California, Berkeley
- *
- */
-
- #define IS_COMPOSITOR (strncmp(&no[i], page_comp, comp_len) == 0)
-
- #define ROMAN_I 'I'
- #define ROMAN_V 'V'
- #define ROMAN_X 'X'
- #define ROMAN_L 'L'
- #define ROMAN_C 'C'
- #define ROMAN_D 'D'
- #define ROMAN_M 'M'
-
- #define ROMAN_i 'i'
- #define ROMAN_v 'v'
- #define ROMAN_x 'x'
- #define ROMAN_l 'l'
- #define ROMAN_c 'c'
- #define ROMAN_d 'd'
- #define ROMAN_m 'm'
-
- #define VAL_I 1
- #define VAL_V 5
- #define VAL_X 10
- #define VAL_L 50
- #define VAL_C 100
- #define VAL_D 500
- #define VAL_M 1000
-
- #define ROMAN_LOWER_VAL(C) \
- ((C == ROMAN_i) ? VAL_I : \
- (C == ROMAN_v) ? VAL_V : \
- (C == ROMAN_x) ? VAL_X : \
- (C == ROMAN_l) ? VAL_L : \
- (C == ROMAN_c) ? VAL_C : \
- (C == ROMAN_d) ? VAL_D : \
- (C == ROMAN_m) ? VAL_M : 0)
-
- #define ROMAN_UPPER_VAL(C) \
- ((C == ROMAN_I) ? VAL_I : \
- (C == ROMAN_V) ? VAL_V : \
- (C == ROMAN_X) ? VAL_X : \
- (C == ROMAN_L) ? VAL_L : \
- (C == ROMAN_C) ? VAL_C : \
- (C == ROMAN_D) ? VAL_D : \
- (C == ROMAN_M) ? VAL_M : 0)
-
- #define IS_ROMAN_LOWER(C) \
- ((C == ROMAN_i) || (C == ROMAN_v) || (C == ROMAN_x) || \
- (C == ROMAN_l) || (C == ROMAN_c) || (C == ROMAN_d) || (C == ROMAN_m))
-
- #define IS_ROMAN_UPPER(C) \
- ((C == ROMAN_I) || (C == ROMAN_V) || (C == ROMAN_X) || \
- (C == ROMAN_L) || (C == ROMAN_C) || (C == ROMAN_D) || (C == ROMAN_M))
-
- #define ALPHA_VAL(C) \
- ((('A' <= C) && (C <= 'Z')) ? C - 65 : \
- (('a' <= C) && (C <= 'z')) ? C - 97 : 0)
-
- #define IS_ALPHA_LOWER(C) \
- (('a' <= C) && (C <= 'z'))
-
- #define IS_ALPHA_UPPER(C) \
- (('A' <= C) && (C <= 'Z'))
-
- #define IDX_SKIPLINE { \
- int tmp; \
- while ((tmp = GET_CHAR(idx_fp)) != LFD) \
- if (tmp == EOF) \
- break; \
- idx_lc++; \
- arg_count = -1; \
- }
-
- #define NULL_RTN { \
- IDX_ERROR("Illegal null field.\n", NULL); \
- return (FALSE); \
- }
-
- #if KCC_20
- /* KCC preprocessor bug collapses multiple blanks to single blank */
- #define IDX_ERROR(F, D) { \
- if (idx_dot) { \
- fprintf(ilg_fp, "\n"); \
- idx_dot = FALSE; \
- } \
- fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n\040\040 -- ", \
- idx_fn, idx_lc); \
- fprintf(ilg_fp, F, D); \
- idx_ec++; \
- }
-
- #define IDX_ERROR2(F, D1, D2) { \
- if (idx_dot) { \
- fprintf(ilg_fp, "\n"); \
- idx_dot = FALSE; \
- } \
- fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n\040\040 -- ", \
- idx_fn, idx_lc); \
- fprintf(ilg_fp, F, D1, D2); \
- idx_ec++; \
- }
- #else
- #define IDX_ERROR(F, D) { \
- if (idx_dot) { \
- fprintf(ilg_fp, "\n"); \
- idx_dot = FALSE; \
- } \
- fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n -- ", \
- idx_fn, idx_lc); \
- fprintf(ilg_fp, F, D); \
- idx_ec++; \
- }
-
- #define IDX_ERROR2(F, D1, D2) { \
- if (idx_dot) { \
- fprintf(ilg_fp, "\n"); \
- idx_dot = FALSE; \
- } \
- fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n -- ", \
- idx_fn, idx_lc); \
- fprintf(ilg_fp, F, D1, D2); \
- idx_ec++; \
- }
- #endif
-
-
- #define ENTER(V) { \
- if (*count >= PAGEFIELD_MAX) { \
- IDX_ERROR2("Page number %s has too many fields (max. %d).", \
- no, PAGEFIELD_MAX); \
- return (FALSE); \
- } \
- npg[*count] = (V); \
- ++*count; \
- }
-